{% extends 'layout.html' %}
{% block content %}
<div class="listBox thumbnail">
    <h4 class="text-center caption">{{con.title}}</h4>
    <p class="text-center">
        作者：<span class="colInfo text-primary">{{con.user.username}}</span>
        时间：<span class="colInfo text-primary">{{con.addTime | date('Y-m-d H:i:s', -8*60)}}</span>
        阅读：<span class="colInfo text-primary">{{con.views}}</span>
        评论：<span class="colInfo text-primary commentsCount"></span>
    </p>
    <dfn>
        {{con.content}}
    </dfn>
</div>
<div class="panel panel-info">
    <div class="panel-heading flex"><strong>评论</strong> 
        <span>一共有<em class="commentsCount"></em>条评论</span>
    </div>
    <div class="panel-body">
            {% if userInfo._id %}
            <div class="form-group">
              <label for="exampleInputEmail1">发表评论</label>
              <div class="input-group">
                <textarea class="form-control" id="messageBox" placeholder="说两句吧"></textarea>
                <input type="hidden" id="contentId" value="{{con.id}}">
                <span class="input-group-btn">
                  <button class="btn btn-primary submit btn-lg submitBtn" id="messageBtn" type="button">提交</button>
                </span>
              </div>
            </div>
            {% else %}
            <div class="bg-danger text-primary colWarning">暂未登录，请先登录</div>
            {% endif %}
    </div>
    
    <ul class="panel-footer list-group messageList">
    </ul>
    <div class="pager">
        <ul class="clear">
            <li class="previous"></li>
            <li></li>
            <li class="next"></li>
        </ul>
    </div>
  </div>
  <script src="/public/js/comment.js"></script>
{% endblock %}